<?php if( count($this->blogs) >  0 ): ?>
<ul class="ynblog_slideshow_container" id ="ynblog_slideshow_container">
	<li>
		<div id ="slide-runner-widget" class='slideshow'>
    <?php  foreach($this->blogs as $item):
           $owner = $item->getOwner();?>
			<div class="slide">
      <div class="featured_blogs">
				<div class="featured_blogs_img_wrapper">
            <div class="featured_blogs_img">
                <a href="<?php echo $item->getHref()?>">
                  <?php if($item->getOwner()->getPhotoUrl("thumb.profile")!= null):?>
                  <img src="<?php echo $item->getOwner()->getPhotoUrl("thumb.profile");?>" />
                  <?php else:?>
                  <img src="./application/modules/User/externals/images/nophoto_user_thumb_normal.png" />
                  <?php endif;?>
                </a>
            </div>
        </div>
        <div class="blog_info">
            <div class="blog_title">
                <b><?php echo $item ?></b>
            </div>
            <div class="blog_owner">
                <?php echo $this->translate("Posted by");?>
                <?php echo $owner;?>
                -
                <?php echo $this->timestamp($item->creation_date); ?>
            </div>
            <p class="blog_body">
                <?php echo Engine_Api::_()->ynblog()->subPhrase(strip_tags($item->body),500);?>
            </p>
        </div>
      </div>
		</div>
    <?php  endforeach; ?>
		</div>
	</li>
</ul>
<script type="text/javascript">
	jQuery(document).ready(function(){
		var slideWidth = jQuery('.slideshow').width();
	    /* call divSlideShow without parameters */
	    jQuery('.slideshow').divSlideShow({
	    width: slideWidth,
		height:290,
		loop:1000,
		delay:5000,
		arrow:'begin',
		controlClass:'slideshow_action',
		controlActiveClass:'slideshow_action_active'
		});
	});
</script>
<?php else: ?>
<div class="tip">
      <span>
        <?php echo $this->translate('There are no featured blogs yet.');?>
      </span>
    </div>
<?php endif;?>